#include "brain.h"

#include <iostream>

using namespace Komari;

// g++ brain.cc brain_test.cc -o test
int main()
{
    Brain b = Brain(0.1, 0.5, 5555);
    std::cout << "Start!!!" << std::endl;
    b.AddExplicitArea("A", 100, 10, 0.5);
    b.AddArea("B", 10000, 100, 0.5);
    // b.getAreaByName("A").fire(30, 40);
    // b.info();
    // b.Project("B", {"A"});
    // b.ProjectStar({{"B", {"A"}}});
    // b.info();
    // b.ProjectStar({{"A", {"B"}}});
    // b.info();
    b.getAreaByName("A").fire(10, 20);
    b.getAreaByName("A").is_fixed_ = 0;
    b.ProjectStar({{"B", {"A"}}});
    b.info();
    // b.ProjectStar({{"A", {"B"}}, {"B", {"A", "B"}}});
    // b.ProjectStar({{"A", {"B"}}, {"B", {"A", "B"}}});
    for (size_t i = 0; i < 30; i++)
    {
        b.ProjectStar({{"A", {"B"}}, {"B", {"A", "B"}}});
        std::cout << "size_support of B:" << b.getAreaByName("B").size_support_ << std::endl;
    }
    b.info();
    b.getAreaByName("A").is_fixed_ = 0;
    b.ProjectStar({{"A", {"B"}}, {"B", {"A", "B"}}});
    b.info();
    for (size_t i = 0; i < 5; i++)
    {
        b.ProjectStar({{"A", {"B"}}, {"B", {"A", "B"}}});
        std::cout << "size_support of B:" << b.getAreaByName("B").size_support_ << std::endl;
    }
    b.info();

    std::cout << "Finished!!!" << std::endl;
    return 0;
}